package com.imooc.mall.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;
import org.apache.commons.lang3.StringUtils;

@Getter
@AllArgsConstructor
public enum PaymentTypeEnum {


    ONLINE_PAY(1),
    ;
    private Integer code;

    public static Integer getCode(String name){
        if (StringUtils.isNotBlank(name)){
          return  PaymentTypeEnum.valueOf(name).code;
        }
        return null;
    }


}
